package team.southcat.wsyygh.model.enums;

public enum CategoryEnum {

    HOSPITAL_TYPE("医院等级", 2),
    CERTIFICATE_TYPE("证件类型", 3),
    EDUCATION_TYPE("学历", 4),
    NATIONALITY_TYPE("民族", 5),
    ;

    private String name;
    private Integer code;

    CategoryEnum(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public static Integer getCodeByName(String name) {
        CategoryEnum arrObj[] = CategoryEnum.values();
        for (CategoryEnum obj : arrObj) {
            if (name.equals(obj.getName())){
                return obj.getCode();
            }
        }
        return -1;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
